define([ "esri/Color", "esri/symbols/SimpleFillSymbol", "esri/symbols/SimpleLineSymbol", "dojo/domReady!" ],
	function(Color, SimpleFillSymbol, SimpleLineSymbol) {
		return {
			addGraToMap : function(map, resultFeatures, mys, xys, type) {
				var halfFillYellow = new Color(mys);
				var redColor = new Color(xys);
				var sil = new SimpleLineSymbol(SimpleLineSymbol.STYLE_SOLID,
					redColor, 2);
				var polygonSym = new SimpleFillSymbol(
					SimpleFillSymbol.STYLE_SOLID, sil, halfFillYellow);
				for (var i = 0, il = resultFeatures.length; i < il; i++) {
					var symbol = polygonSym;
					var graphic = resultFeatures[i];
					graphic.setSymbol(symbol);
					type.add(graphic);
				}
				var extent = resultFeatures[0].geometry.getExtent();
				if (resultFeatures.length > 1) {
					for (var k = 1; k < resultFeatures.length; k++) {
						extent = extent.union(resultFeatures[k].geometry.getExtent());
					}
				}
				extent.spatialReference = map.spatialReference;
				map.setExtent(extent.expand(1));
			},
		};
	});